home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / gnuplot / term / unixplot.trm < prev    next >
Text File  |  1993-09-15  |  2KB  |  108 lines

  1. /*
  2.  * $Id: unixplot.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT -- unixplot.trm */
  7. /*
  8.  * Copyright (C) 1990 - 1993   
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *  Unix plot(5) graphics language
  26.  *
  27.  * AUTHORS
  28.  *  Colin Kelley, Thomas Williams, Russell Lang
  29.  * 
  30.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  31.  * 
  32.  */
  33.  
  34. /*
  35. Unixplot library writes to stdout.  A fix was put in place by
  36. ..!arizona!naucse!jdc to let set term and set output redirect
  37. stdout.  All other terminals write to outfile.
  38. */
  39.  
  40. #define UP_XMAX 4096
  41. #define UP_YMAX 4096
  42.  
  43. #define UP_XLAST (UP_XMAX - 1)
  44. #define UP_YLAST (UP_YMAX - 1)
  45.  
  46. #define UP_VCHAR (UP_YMAX/30)    /* just a guess--no way to know this! */
  47. #define UP_HCHAR (UP_XMAX/60)    /* just a guess--no way to know this! */
  48. #define UP_VTIC (UP_YMAX/80)
  49. #define UP_HTIC (UP_XMAX/80)
  50.  
  51. UP_init()
  52. {
  53.     openpl();
  54.     space(0, 0, UP_XMAX, UP_YMAX);
  55. }
  56.  
  57.  
  58. UP_graphics()
  59. {
  60.     erase();
  61. }
  62.  
  63.  
  64. UP_text()
  65. {
  66. }
  67.  
  68.  
  69. UP_linetype(linetype)
  70. int linetype;
  71. {
  72. static char *lt[2+5] = {"solid", "longdashed", "solid", "dotted","shortdashed",
  73.     "dotdashed", "longdashed"};
  74.  
  75.     if (linetype >= 5)
  76.         linetype %= 5;
  77.     linemod(lt[linetype+2]);
  78. }
  79.  
  80.  
  81. UP_move(x,y)
  82. unsigned int x,y;
  83. {
  84.     move(x,y);
  85. }
  86.  
  87.  
  88. UP_vector(x,y)
  89. unsigned int x,y;
  90. {
  91.     cont(x,y);
  92. }
  93.  
  94.  
  95. UP_put_text(x,y,str)
  96. unsigned int x,y;
  97. char str[];
  98. {
  99.     UP_move(x+UP_HCHAR/2,y+UP_VCHAR/5);
  100.     label(str);
  101. }
  102.  
  103. UP_reset()
  104. {
  105.     closepl();
  106. }
  107.  
  108.